Repository navigation
fix(core): reset creation mode when diffing into an existing projection - #8715
Merged
maiieul merged 3 commits intoJun 11, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 3014f12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@qwik.dev/core
@qwik.dev/router
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
commit: |
Contributor
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Varixo
reviewed
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is it?
Description
When a component throws a promise on first client render (e.g. a library resolving QRLs by throwing, like formisch's
useResolvedQrl) and the promise resolution writes a signal the component already subscribed to, the component is diffed a second time before its child component has rendered its<Slot />. At that point the child host has no children yet, sodescend()flips$isCreationMode$on, and the sticky flag leaks into the existing projection from the first pass.expectElementthen blindly re-creates plain element children instead of matching them (components survive becauseexpectComponentmatches by hash), and a trailing component sibling jumps the cursor past the stale element soexpectNoMorenever cleans it up — leaving duplicated DOM.Symptom in an app: form fields rendered twice on every first SPA navigation to a route, correct again when revisiting (cached QRLs resolve synchronously, so nothing throws).
The fix: a projection never inherits creation mode from the surrounding level — an existing projection keeps its children across re-renders, so they must be diffed against, never re-created; it is in creation mode only when new or empty. Handled in
descend()via anisProjectionparam (replacingshouldExpectNoChildren, which was already projection-only). Regression tests cover default and named slots; both fail without the behavior change.Checklist
pnpm change